package com.ruoyi.common.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadManager {

    private static final int N_CPUS = Runtime.getRuntime().availableProcessors();

    private ExecutorService executorService = Executors.newFixedThreadPool(N_CPUS / 2);

    private static ThreadManager me = new ThreadManager();

    public static ThreadManager me()
    {
        return me;
    }


    public void execute(Runnable runnable)
    {
        executorService.execute(runnable);
    }


}
